From fd01723470aa694f5f0b25929d2434846bbb1535 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Sat, 5 Dec 2020 11:40:47 +0100 Subject: [PATCH] x11/surface: Avoid resizing if computed size didn't change This fixes an issue where we'd resize to the previous window size during interactive resize. --- gdk/x11/gdksurface-x11.c | 6 +++++- gdk/x11/gdksurface-x11.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index e80e0beff4..6680312563 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -325,11 +325,15 @@ compute_toplevel_size (GdkSurface *surface, gdk_surface_constrain_size (&geometry, mask, size.width, size.height, &size.width, &size.height); - if ((impl->next_layout.configured_width != size.width || + if ((impl->last_computed_width != size.width || + impl->last_computed_height != size.height) && + (impl->next_layout.configured_width != size.width || impl->next_layout.configured_height != size.height)) { *width = size.width; *height = size.height; + impl->last_computed_width = size.width; + impl->last_computed_height = size.height; return TRUE; } diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h index 134ebdf617..0830407dd0 100644 --- a/gdk/x11/gdksurface-x11.h +++ b/gdk/x11/gdksurface-x11.h @@ -72,6 +72,9 @@ struct _GdkX11Surface int unscaled_width; int unscaled_height; + int last_computed_width; + int last_computed_height; + GdkToplevelLayout *toplevel_layout; struct { -- 2.30.2